
<template tag="以下文档内容为hycli自动生成">
  <div>
    <el-dialog
      v-model="conf.ahq_visible"
      title="权限"
      :close-on-click-modal="false"
      width="60%"
      draggable
      :before-close="hide_ahq"
    >
      <el-form
        :model="form_ahq"
        
        ref="fm_ahq"
        :rules="rules_ahq"
      >
  <el-row>
</el-row>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="hide_ahq">取消</el-button>
          <el-button type="primary" @click="save_ahq">提交</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data(){
    return{
      conf:{
        ahq_visible:false,
      },
      //权限 form by  
    form_ahq:{},
    rules_ahq:{
        },
    }
  },
  methods:{
     //--------------------权限---------------------------------
      //显示 权限 弹出框 {"Tag":"DIALOG","Name":"CMPNT","Cmd":"batupdator","Label":"权限","ICON":"","URL":"@/views/{@prefix}/{@main}/{@name}.dialog","RwName":"","FwName":"","ReqURL":"menu","IsMux":true,"Position":"lstbar","Table":"sso_role_info","Params":{},"ParentUNQ":"","UNQ":"ahq"}
      show_ahq(fm){
          
        //处理关联表@/views/{@prefix}/{@main}/{@name}.dialog
        let currentForm = {}

         Object.assign(this.form_ahq,currentForm)
         Object.assign(this.form_ahq,fm)
         this.conf.ahq_visible = true;
      },
      //隐藏 权限 弹出框
      hide_ahq(){
        this.conf.ahq_visible = false;
        this.$refs.fm_ahq.resetFields();
      },
      //保存 权限 弹出框数据
      save_ahq(){
        let that = this
        this.$refs.fm_ahq.validate((v=>{
            if(!v){
                return
            }
        let post_form_ahq = this.form_ahq
        
        this.$theia.http.post("/sso/role/info/menu",post_form_ahq).then(res=>{
            that.$notify.success({title: '成功',message: '提交成功',duration:5000})
            that.$emit("onsaved")
            that.hide_ahq()
            
        }).catch(res=>{
          let code = res.response.status
          let msg= `提交失败(${code})`
          that.$notify.error({title: '失败',message:msg,duration:5000})
        })
        }))
    },
    //-----------------------------------------------------------
  },
}
</script>